﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B.S.XZYData.Domain.XZY
{
    /// <summary>
    /// 不良品项分布表
    /// </summary>
    [SugarTable("DefectiveItemDistribution")]
    public class DefectiveItemDistribution
    {
        /// <summary>
        /// 自增主键
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }

        /// <summary>
        /// 记录时间
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public DateTime Time { get; set; }

        /// <summary>
        /// 不良品项编号
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public string DefectiveItemCode { get; set; }

        /// <summary>
        /// 不良品项名称
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public string DefectiveItemName { get; set; }

        /// <summary>
        /// 不良数量
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public int Quantity { get; set; }

        /// <summary>
        /// 统计周期总数量
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public int TotalQuantity { get; set; }

        /// <summary>
        /// 占比（百分比）
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public decimal Percentage { get; set; }

        /// <summary>
        /// 创建人ID（关联User.Id）
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public int CreatorId { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(IsNullable = false)]
        public DateTime CreateTime { get; set; } = DateTime.Now;
        /// <summary>
        /// 逻辑删除
        /// </summary>
        public bool IsDeleted { get; set; } = false;
    }
}
